{include file='admin/before_body.phtml' title='后台首页'}
<style>
.user-avatar { border: 2px solid #c9d6e5;border-radius: 100%;max-width: 50px;margin-right: 10px;margin-left: 0;box-shadow: none; }
tbody .btn { margin-bottom: 2px }
</style>
  {include file='admin/header.phtml'}
    <div class="main-container" id="main-container">
      <script type="text/javascript">try { ace.settings.check('main-container' , 'fixed') }catch(e) {  }</script>
      <div class="main-container-inner">
        {include file='admin/sidebar.phtml'}
        <div class="main-content">
{$breadcrumbs=[]}
{$breadcrumbs[] = ['name' => '礼品管理', 'icon' => 'icon-home home-icon']}
{$breadcrumbs[] = ['name' => '礼品列表', 'isactive' => true]}
{include file='admin/breadcrumb.phtml' breadcrumbs=$breadcrumbs}
          <div class="page-content">
            {html_messages}
            <div class="row">
              {include file='admin/gift/exchange_search.phtml'}
              <div class="col-xs-12"><div class="space-6"></div></div>
<div class="col-xs-12">
  <p>
  </p>
  <div class="table-responsive">
    <div id="sample-table-2_wrapper" class="dataTables_wrapper" live="grid">
      <table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
        <thead>
          <tr>
            <th class="center">申请人</th>
            <th class="center">详情</th>
            <th class="center" width="100">类型</th>
            <th class="center" width="100">状态</th>
            <th class="center" width="100">创建时间</th>
            <th class="center" width="100">更新时间</th>
            <th class="center" width="120">操作</th>
          </tr>
        </thead>
        <tbody>
          {if empty($list)}
            <tr><td colSpan="10"><p class="center">找不到符合条件的记录<p></td></tr>
          {/if}
          {foreach $list as $playerGift}
            <tr data-id="{$playerGift->_id}">
             <td class="center"><img class="user-avatar" src="{$playerGift->headimgurl}"><hr>{$playerGift->nickname}</td>
              <td class="left">
              <p>礼品：{$playerGift->data['name']}</p>
 {if $playerGift->type == Gift::IS_PRODUCT}
<p>收货人：{$playerGift->data['realname']}</p>
<p>联系电话：{$playerGift->data['phone']}</p>
<p>地址：{$playerGift->data['address']}</p>
 {/if}
 {if $playerGift->type == Gift::IS_COUPON}
 口令：{$playerGift->data['coupon']}
 {/if}

              </td>
              <td class="center">
              {if $playerGift->type == Gift::IS_PRODUCT}
                <span class="label label-sm label-info arrowed arrowed-righ">商品</span>
              {elseif $playerGift->type == Gift::IS_COUPON}
                <span class="label label-sm label-yellow arrowed arrowed-righ">优惠券</span>
              {else}
                {$playerGift->type}
              {/if}
              </td>
              <td class="center">
              {if $playerGift->status == PlayerGift::IS_CREATE}
                <span class="label label-sm label-warning arrowed arrowed-righ">未发货</span>
              {elseif $playerGift->status == PlayerGift::IS_SEND}
                <span class="label label-sm label-success arrowed arrowed-righ">已发货</span>
              {else}
                {$playerGift->status}
              {/if}
              </td>
              <td class="center">{$playerGift->created|date_format:'Y-m-d G:i:s'}</td>
              <td class="center">{$playerGift->updated|date_format:'Y-m-d G:i:s'}</td>
              <td class="center">
               {if $playerGift->status == PlayerGift::IS_CREATE}
                <a href="{url('admin/gift/exchangeUpdated/send/')}{$playerGift->_id}" class="btn btn-xs btn-warning modal-confirm" data-title="确认发货" data-confirm="<dd>礼品:{$playerGift->data['name']}<dd/><dd>收货人：{$playerGift->data['realname']}<dd/><dd>联系电话：{$playerGift->data['phone']}<dd/><dd>地址：{$playerGift->data['address']}</dd>">发货</a>
                {/if}
              </td>
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="row">
        <div class="col-sm-6">
        </div>
        <div class="col-sm-6">
          <div class="dataTables_paginate paging_bootstrap">
            {html_pagination page="$page" rows="$rows" count="$count" showinfo="1"
              url="{url('admin/gift/exchange')}" query=$query}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



            </div>
          </div>
        </div>
      </div>
    </div>
</body>
{include file='admin/after_body.phtml'}
</html>

